package com.sdry.service.impl.cb;

import com.sdry.mapper.cb.ReportJinMapper;
import com.sdry.model.cb.Menu;
import com.sdry.model.jyy.Receive;
import com.sdry.service.cb.ReportJinService;
import com.sdry.utils.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReportJinServiceImpl implements ReportJinService {

    @Autowired
    private ReportJinMapper reportJinMapper;

    @Override
    public List<Receive> getList(String selectTime, String maName, String date, Long customer_id, String selectType) {
        if ("2".equals(selectTime) || "3".equals(selectTime)) {
            date = "3";
        }
        if (StringUtil.isEmpty(date)) {
            date = null;
        }if ("3".equals(date)) {
            date = null;
        }
        if (StringUtil.isEmpty(maName)){
            maName = null;
        }
        return reportJinMapper.getList(selectTime,maName,date,customer_id,selectType);
    }

    @Override
    public List<Menu> getMenu(String date) {
        return reportJinMapper.getMenu(date);
    }


}
